package com.geqian.web.controller;

import com.geqian.common.common.PageRequest;
import com.geqian.common.common.PageResult;
import com.geqian.common.common.ResponseResult;
import com.geqian.web.annotation.ExcludeLog;
import com.geqian.web.entity.ApiLog;
import com.geqian.web.service.ApiLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


/**
* 接口访问日志控制器
* @author geqian
* @date 2023-12-10 18:34:11
*/
@RestController
@RequestMapping("/apiLog")
@Api(tags = "接口访问日志")
@ExcludeLog
public class ApiLogController {

    @Resource
    private ApiLogService apiLogService;

    @ApiOperation("获取接口访问日志列表")
    @GetMapping("/getApiLogList")
    public ResponseResult<PageResult<ApiLog>> getApiLogList(PageRequest pageRequest){
        return apiLogService.getApiLogList(pageRequest);
    }



    @ApiOperation("删除接口访问日志")
    @PostMapping("/deleteApiLog")
    public ResponseResult<String> deleteApiLog(@RequestBody List<ApiLog> apiLogList) {
        return apiLogService.deleteApiLog(apiLogList);
    }

}